﻿#region Using

using System.Collections.Generic;

#endregion

namespace EigenFaces {
	internal class ClassReduceStrategyFurthestFromCurrent : IClassReduceStrategy {
		public void Reduce(List<DotNetMatrix.Matrix> list, DotNetMatrix.Matrix trait) {
			var distance = double.MinValue;
			var pos = 0;
			for( var i = 0; i < list.Count; i++ ) {
				var d = list[i].EuclidDistance(trait);
				if( d > distance ) {
					distance = d;
					pos = i;
				}
			}
			list.RemoveAt(pos);
		}


		override public string ToString() {
			return "Entferntestes vom Letzten";
		}

	}
}
